package com.hqhsc.module.front.activity.dao;

import com.hqhsc.core.dao.BaseJdbcDaoImpl;
import com.hqhsc.module.common.dao.CommonDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Repository
public class SignDao extends BaseJdbcDaoImpl {
	final Logger logger = LoggerFactory.getLogger(SignDao.class);


    /**
     * 活动用户，现场扫码签到
     * @param activity_id
     * @param dn
     * @return
     */
    public int activityUserDoSign(long activity_id , String dn) {
        String sql = "update activity_users set is_sign = 1 where activity_id = ? and dn = ? ";
        Object[] o = new Object[]{ activity_id , dn };
        logger.info(sql.replaceAll("\\?", "{}"), o);
        return this.getJdbcTemplate().update(sql, o);
    }

}
